﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ImobitechModel.com.Controller;
using ImobitechModel.com.Constantes;

namespace Imobitech.Perfil
{
    public partial class LoginAdmin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            IDictionary<string, string> login = new Dictionary<string, string>();

            login.Add(NomeCampoConstantes.campo_Login, txtLogin.Text);
            login.Add(NomeCampoConstantes.campo_Senha, txtSenha.Text);

            ControladorPerfis cg = new ControladorPerfis();
            Logar retorno = (Logar)cg.loginAdmin(login);
            Session.Add("loginAdmin", retorno);
            Response.Redirect(retorno.url);
        }
    }
}